<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Index_Catalog extends Controller_Base {
    
    public function before() {
        parent::before();
        
        $menu = Request::factory('widgets/menu')->execute();        
        $login = Request::factory('widgets/login')->execute();
        $this->template->block_left = array($menu, $login);
        
    }

    public function action_index() {
        $products = Model::factory('catalog')->all_products();        
        $content = View::factory('index/v_catalog', array(
            'products' => $products
        ));
        
        $this->template->page_title = 'Каталог';
        $this->template->block_center = array($content);
    }
}

